# a = [1,2,3,4]
# print(a[1:3])
#
# a = [1,2,3,4]
# print(a[1:])
# print(a[:2])
#
# a = [1,2,3,4,5,6,7,8,9,0]
# print(a[1:10000])

# a = [1,2,3,4,5]
# for elem in a:
#     print(elem)

# a = [1,2,3,4,5]
# for i in range(0,len(a)):
#     a[i] += 10
#     print(a[i])
# print(a)

# a = [1,2,3,4,5]
# i = 0
# while i < len(a):
#     print(a[i])
#     i += 1

# a = [1,2,3,4]
# a.append(5)
# a.append("hello")
# print(a)


# a = [1,2,3,4]
# a.insert(1000, "hello") # "hello"插入到列表中下标为1的位置
# print(a)

# a = [1,2,3,4]
# print(1 in a)
# print(10 in a)
# print(1 not in a)
# print(10 not in a)

# a = [1,2,3,4]
# print(a.index(2))
# print(a.index(99)) #查找不存在的元素时抛出异常

# a = [1,2,3,4]
# a.pop()
# print(a)

# a = [1,2,3,4]
# a.pop(2)
# print(a)

# a = ["aa","bb","cc","dd"]
# a.remove("bb")
# print(a)

# a = [1,2,3,4]
# b = [5,6,7,8]
# print(a + b)

# a = [1,2,3,4]
# b = [5,6,7,8]
# c = a.extend(b)
# print(a)
# print(b)
# print(c)

a = [1,2,3,4]
b = [5,6,7,8]
a += b
print(a)
print(b)